#include<bits/stdc++.h>
using namespace std;
int a[21000],v[21000];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		v[a[i]]++;
	}
	for(int i=1;i<=n;i++)
	{
		if(v[a[i]]==0)
			continue;
		else if(v[a[i]]!=1)
		{
			v[a[i]]=0;
			cout<<a[i]<<" ";
		}
		else
			cout<<a[i]<<" ";
	}
    return 0;
}
